"use client";
import { usePathname } from 'next/navigation';
import { Sidebar } from '@/components/sidebar';
import { Toaster } from '@/components/ui/sonner';
// 客户端组件用于检测路径
export function ClientLayout({ children, locale }: { children: React.ReactNode, locale: string }) {
  const pathname = usePathname();
  const isAuthPage = pathname.includes('/auth');
  return (
    <>
      <Toaster position="top-right" />
      {isAuthPage ? (
        // 认证页面布局 - 不显示侧边栏
        <main className="w-full h-screen overflow-auto">
          {children}
        </main>
      ) : (
        // 普通页面布局 - 显示侧边栏
        <div className="flex h-screen bg-gray-50 dark:bg-gray-950">
          <Sidebar locale={locale} />
          <main className="flex-1 overflow-auto px-6">
            {children}
          </main>
        </div>
      )}
    </>
  );
}
